<!-- eslint-disable max-len -->
<template>
  <a-form-model
    class="detailPaddingPage"
    style="display: flex; flex-direction: column"
    :layout="formLayout"
    :colon="false">
    <a-spin :spinning="loading">
      <!-- 升级任务 -->
    <a-form-model-item :label="$t('upgradeTask')" class="customFormModelItem2"> </a-form-model-item>
    <a-form-model-item>
      <a-row >
        <!-- 模板类型 -->
        <a-col :md="8" :sm="24">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item class="deepClass">
                {{ $t('templateType') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item>
                <table-ellipsis :text="formData.instanceResponse.businessName"></table-ellipsis>
              </a-form-model-item></a-col>
          </a-row>
        </a-col>
        <!-- 任务名称 -->
        <a-col :md="8" :sm="24">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item class="deepClass">
                {{ $t('campaignName') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item>
                <table-ellipsis :text="formData.task.name"></table-ellipsis>
              </a-form-model-item></a-col>
          </a-row>
        </a-col>
        <!-- 任务类型 -->
        <a-col :md="8" :sm="24">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item class="deepClass">
                {{ $t('taskType') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item>
                <table-ellipsis v-if="formData.task.testType==='WAREHOUSE'" text="成品库OTA任务"></table-ellipsis>
                <table-ellipsis v-if="formData.task.testType==='UAT'" text="正式任务"></table-ellipsis>
                <table-ellipsis v-if="formData.task.testType==='DEVELOP'" text="研发测试任务"></table-ellipsis>
              </a-form-model-item></a-col>
          </a-row>
        </a-col>
        <!-- 任务批次名称 -->
        <a-col :md="8" :sm="24">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item class="deepClass">
                {{ $t('batchName') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item>
                <table-ellipsis :text="formData.taskGcyExtVo.batchName"></table-ellipsis>
              </a-form-model-item></a-col>
          </a-row>
        </a-col>
        <!-- 任务批次号 -->
        <a-col :md="8" :sm="24">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item class="deepClass">
                {{ $t('批次号') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item>
                <table-ellipsis :text="formData.task.batchNo"></table-ellipsis>
              </a-form-model-item></a-col>
          </a-row>
        </a-col>

<!--      </a-row>-->
<!--      <a-row >-->
        <!-- 申请人 -->
        <a-col :md="8" :sm="24">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item class="deepClass">
                {{ $t('applicant') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item>
                <table-ellipsis :text="applyUserName"></table-ellipsis>
              </a-form-model-item></a-col>
          </a-row>
        </a-col>
        <!-- 申请时间 -->
        <a-col :md="8" :sm="24">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item class="deepClass">
                {{ $t('applicationTime') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item>
                <table-ellipsis
                  :text="formData.instanceResponse.createTime?
                    $options.filters.moment(formData.instanceResponse.createTime):'-'"
                >
                </table-ellipsis>
              </a-form-model-item></a-col>
          </a-row>
        </a-col>
        <!-- OTA升级范围 -->
        <a-col :md="8" :sm="24" v-if="testType !== 'WAREHOUSE'">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item class="deepClass">
                {{ $t('updateScope') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item>
                <table-ellipsis :text="TaskUtil.transUpdateScope(formData.taskGcyExtVo.updateScope)"></table-ellipsis>
              </a-form-model-item></a-col>
          </a-row>
        </a-col>
<!--      </a-row>-->
<!--      <a-row >-->
        <!-- 升级类型 -->
        <a-col :md="8" :sm="24">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item class="deepClass">
                {{ $t('upgradeType') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item>
                <table-ellipsis :text="$options.filters.DictLabelFilter(formData.task.type,yesOrNoEnumArr12)"/>
              </a-form-model-item></a-col>
          </a-row>
        </a-col>
         <!-- 是否强制升级 -->
        <a-col :md="8" :sm="24" v-if="formData.task.type==1">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item class="deepClass">
                {{ $t('isQzsj') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item>
                <table-ellipsis :text="forceUpgradeTypeObj[formData.task.forceUpgrade]">
                </table-ellipsis>
              </a-form-model-item></a-col>
          </a-row>
        </a-col>
        <!-- 自动升级：是否静默升级 -->
        <a-col :md="8" :sm="24" v-else>
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item class="deepClass">
                {{ $t('sfjmsj') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item>
                <table-ellipsis :text="slienceUpgradeTypeObj[formData.task.silenceUpgrade]">
                </table-ellipsis>
              </a-form-model-item></a-col>
          </a-row>
        </a-col>

<!--      </a-row>-->
<!--      <a-row>-->
        <!-- 有效期 -->
        <a-col :md="8" :sm="24">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item class="deepClass">
                {{ $t('expirationDate') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item>
                <table-ellipsis
                v-if="formData.task.endTime > new Date().getTime() && formData.task.startTime< new Date().getTime()"
                  :text="`${formatExpirationDate(formData.task.endTime - formData.task.startTime)}${$t('day')} ${$t(
                    'surplusDay'
                  ).replace('__CONTENT__',formatExpirationDate(formData.task.endTime - new Date().getTime()))}`"></table-ellipsis>
                <table-ellipsis 
                v-else-if="formData.task.endTime < new Date().getTime()"
                :text="`${formatExpirationDate(formData.task.endTime - formData.task.startTime)}${$t('day')} ${$t(
                    'surplusDay'
                  ).replace('__CONTENT__',0)}`"
                ></table-ellipsis>
                <table-ellipsis
                v-else-if="formData.task.startTime > new Date().getTime()"
                  :text="`${formatExpirationDate(formData.task.endTime - formData.task.startTime)}${$t('day')} ${$t(
                    'surplusDay'
                  ).replace('__CONTENT__',formatExpirationDate(formData.task.endTime - formData.task.startTime))}`"></table-ellipsis>
              </a-form-model-item></a-col>
          </a-row>
        </a-col>
        <!-- 任务车辆 -->
        <a-col :md="8" :sm="24">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item class="deepClass">
                {{ $t('task')+$t('part') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item>
                {{ formData.task.totalVehicle }}&nbsp;&nbsp;
                <a @click="exportTaskVehicle">导出</a>
              </a-form-model-item></a-col>
          </a-row>
        </a-col>
<!--      </a-row>-->
<!--      <a-row >-->
        <!-- OTA备案流程编号 -->
        <a-col :md="8" :sm="24">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item class="deepClass">
                {{ $t('otaBackupNo') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item>
                <table-ellipsis :text="formData.task.recordNo"></table-ellipsis>
              </a-form-model-item></a-col>
          </a-row>
        </a-col>
        <!-- 升级原因 -->
        <a-col :md="8" :sm="24">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item class="deepClass">
                {{ $t('upgradeReason') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item>
                <table-ellipsis :text="formData.task.remark"></table-ellipsis>
              </a-form-model-item></a-col>
          </a-row>
        </a-col>
<!--      </a-row>-->
<!--      <a-row >-->
        <!-- 紧急OTA表单编号 -->
        <a-col :md="8" :sm="24" v-if="testType !== 'WAREHOUSE'">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item class="deepClass">
                {{ $t('emergencySerialNo') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item>
                <table-ellipsis :text="formData.taskGcyExtVo.gcySerialNo"></table-ellipsis>
              </a-form-model-item></a-col>
          </a-row>
        </a-col>
        <!-- 提交报告是否完整 -->
        <a-col :md="8" :sm="24">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item class="deepClass">
                {{ $t('提交报告是否完整') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item>
                <taskGcyUploadInfo :task-gcy-ext="formData.taskGcyExtVo" :task-name="formData.task.name"/>
              </a-form-model-item></a-col>
          </a-row>
        </a-col>

        <!--      </a-row>-->
        <!--      <a-row >-->
        <!-- 自动升级：唤醒通道 -->
        <a-col :md="8" :sm="24" v-if="formData.task.type ==2 && testType !== 'WAREHOUSE'">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item class="deepClass">
                {{ $t('hxtd') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item>
                <table-ellipsis :text="factoryChannelObj[formData.task.factoryChannel] || '-'">
                </table-ellipsis>
              </a-form-model-item></a-col>
          </a-row>
        </a-col>


        <!-- 供应商验证结论 -->
        <a-col :md="8" :sm="24">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item class="deepClass">
                {{ $t('供应商验证结论') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item>
                 <table-ellipsis :text="$store.getters.getDictCodeObj('gcyOtaSupplierVerifyResultDictCode')[formData.taskGcyExtVo.supplierVerifyConclusion]"></table-ellipsis>
                 <!-- <table-ellipsis :text="formData.taskGcyExtVo.supplierVerifyConclusion"></table-ellipsis> -->
              </a-form-model-item></a-col>
          </a-row>
        </a-col>
        <!-- 产品验证结论 -->
        <a-col :md="8" :sm="24">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item class="deepClass">
                {{ $t('产品验证结论') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item>
                <table-ellipsis :text="$store.getters.getDictCodeObj('gcyOtaSupplierVerifyResultDictCode')[formData.taskGcyExtVo.productVerifyConclusion]"></table-ellipsis>
                <!-- <table-ellipsis :text="formData.taskGcyExtVo.supplierVerifyConclusion"></table-ellipsis> -->
              </a-form-model-item></a-col>
          </a-row>
        </a-col>
      </a-row>
    </a-form-model-item>
    <!-- 升级策略 -->
    <a-form-model-item :label="$t('sjcl')" class="customFormModelItem2"> </a-form-model-item>
    <a-form-model-item>
      <a-row >
        <!-- 策略名称 -->
        <a-col :md="8" :sm="8">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item class="deepClass">
                {{ $t('policyName') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item>
                <table-ellipsis :text="formData.strategyVo.name"></table-ellipsis>
              </a-form-model-item></a-col>
          </a-row>
        </a-col>
        <!-- 车型代码 -->
        <a-col :md="8" :sm="8">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item class="deepClass">
                {{ $t('modelCode') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item>
                <table-ellipsis :text="formData.strategyVo.modelCode"></table-ellipsis>
              </a-form-model-item></a-col>
          </a-row>
        </a-col>
        <!-- 车型名称 -->
        <a-col :md="8" :sm="8">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item class="deepClass">
                {{ $t('modelName') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item>
                <table-ellipsis :text="formData.strategyVo.modelName"></table-ellipsis>
              </a-form-model-item></a-col>
          </a-row>
        </a-col>
      </a-row>
      <a-row >
        <!-- 款型代码 -->
        <a-col :md="8" :sm="8">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item class="deepClass">
                {{ $t('stereotypeCode') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item>
                <table-ellipsis :text="formData.vehicleVersionVo.model.trimLevelCode"></table-ellipsis>
              </a-form-model-item></a-col>
          </a-row>
        </a-col>
        <!-- 款型名称 -->
        <a-col :md="8" :sm="8">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item class="deepClass">
                {{ $t('stereotype') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item>
                <table-ellipsis :text="formData.vehicleVersionVo.model.trimLevel"></table-ellipsis>
              </a-form-model-item></a-col>
          </a-row>
        </a-col>
        <!-- 车型版本 -->
        <a-col :md="8" :sm="8">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item class="deepClass" v-if="testType == 'WAREHOUSE'">
                智驾域版本号
              </a-form-model-item>
              <a-form-model-item class="deepClass" v-else>
                {{ $t('vehicleModel')+$t('version') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item>
                <table-ellipsis :text="formData.strategyVo.vehicleVersionName"></table-ellipsis>
              </a-form-model-item></a-col>
          </a-row>
        </a-col>
      </a-row>
      <a-row >
        <!-- 车辆ECU -->
        <a-col :md="8" :sm="8">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item class="deepClass">
                {{ $t('vehicleInfor') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item>
                <a @click="showEcuTable=!showEcuTable">{{ showEcuTable?$t('packup'):$t('packdown') }}</a>
              </a-form-model-item></a-col>
          </a-row>
        </a-col>
      </a-row>
      <a-table
        :columns="columns"
        :data-source="formData.vehicleVersionVo.ecuVersions"
        :pagination="false"
        style="width:90%;marginLeft:5%"
        v-show="showEcuTable">
        <span slot="formsId" slot-scope="text,record">{{ record.ecu.softFormNo }}</span>
        <span slot="name1" slot-scope="text,record">{{ record.ecu.name }}</span>
        <span slot="name2" slot-scope="text,record">{{ record.ecu.ecuModuleId }}</span>
                 <span slot="softwareCode" slot-scope="text,record">{{ record.ecu.softwareCode }}</span>
        <span slot="versionType" slot-scope="text,record">{{ text  }}</span>
        <span slot="name3" slot-scope="text,record">{{ record.version.name }}</span>
        <a slot="name4" slot-scope="text,record" @click="() => showRelease(record)">{{ $t('view') }}</a>
        <span slot="name5" slot-scope="text,record">
          {{ record.version.configVersionName?record.version.configVersionName:'-' }}
        </span>
        <span slot="name6" slot-scope="text,record">
          {{ record.groupNo?record.groupNo:'-' }}
        </span>
        <span slot="name8" slot-scope="text,record">{{ record.ecu.groupUpgradeNo }}</span>
        <span
          slot="isRollback"
          slot-scope="text,record">
          {{ record.groupRollback === true ? $t('rollbackYes') : (record.groupRollback === false ? $t('rollbackNo') : '') }}
        </span>
        <span slot="updateOrder" slot-scope="text,record">{{ record.groupUpgradeNo?record.groupUpgradeNo:'-' }}</span>
        <span slot="customTitle">
          {{ $t('dependentGrouping') }}
          <question-mark-tip
            :tip-title="$t('dependentGroupingColumnTip')"
            :popupContainer="getPopupContainerColumn"
          ></question-mark-tip>
        </span>
        <span slot="isRollback">
          {{ $t('isRollback') }}
          <question-mark-tip
            :tip-title="$t('isRollbackColumnTip')"
            :popupContainer="getPopupContainerColumn"
          ></question-mark-tip>
        </span>
        <span slot="updateOrder">
          {{ $t('updateOrder') }}
          <question-mark-tip
            :tip-title="$t('updateOrderColumnTip')"
            :popupContainer="getPopupContainerColumn"
          ></question-mark-tip>
        </span>
        <span slot="engineerAcademy" slot-scope="text,record">{{ record.ecu.gcyFormNo }}</span>
      </a-table>
    </a-form-model-item>
    <!-- 条件策略 -->
    <a-form-model-item :label="$t('tjcl')" class="customFormModelItem2"> </a-form-model-item>
    <a-form-model-item>
      <a-row >
        <!-- 策略名称 -->
        <a-col :md="8" :sm="8">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item
                :colon="false"
                class="deepClass"
              >
                {{ $t('policyName') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item
                :colon="false"
                prop="countDown"
              >
                <table-ellipsis :text="formData.strategyVo.conditionStrategyName"></table-ellipsis>
              </a-form-model-item>
            </a-col>
          </a-row>
        </a-col>
        <!-- soc电量 -->
        <a-col :md="8" :sm="8">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item
                :colon="false"
                class="deepClass"
              >
                <question-mark-tip :tip-title="$t('socdlTip')" >
                </question-mark-tip>
                {{ $t('socdl') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item
                :colon="false"
                prop="countDown"
              >
                <table-ellipsis :text="formDataItems.lowestSoc || '-'"></table-ellipsis>
              </a-form-model-item>
            </a-col>
          </a-row>
        </a-col>
        <!-- 蓄电池电压 -->
        <a-col :md="8" :sm="8">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item
                :colon="false"
                class="deepClass"
              >
                <question-mark-tip :tip-title="$t('xdcdyTip')" >
                </question-mark-tip>
                {{ $t('xdcdy') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item
                :colon="false"
                prop="countDown"
              >
                <table-ellipsis :text="formDataItems.lowestVoltage || '-'"></table-ellipsis>
              </a-form-model-item>
            </a-col>
          </a-row>
        </a-col>
      </a-row>
      <a-row >
        <!-- 倒计时时长(min) -->
        <a-col :md="8" :sm="24">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item
                :colon="false"
                class="deepClass"
              >
                <question-mark-tip :tip-title="$t('djsscTip')" >
                </question-mark-tip>
                {{ $t('djssc') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item
                :colon="false"
                prop="countDown"
              >
                <table-ellipsis :text="formDataItems.countDown || '-'"></table-ellipsis>
              </a-form-model-item>
            </a-col>
          </a-row>
        </a-col>
        <!-- 可升级温度 -->
        <a-col :md="8" :sm="24">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item
                :colon="false"
                class="deepClass"
              >
                <question-mark-tip :tip-title="$t('ksjcwdTip')" >
                </question-mark-tip>
                {{ $t('ksjcwd') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item
                :colon="false"
                prop="countDown"
              >
                <table-ellipsis :text="formDataItems.temperature || '-'"></table-ellipsis>
              </a-form-model-item>
            </a-col>
          </a-row>
        </a-col>
        <!-- 下载失败次数 -->
        <a-col :md="8" :sm="24">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item
                :colon="false"
                class="deepClass"
              >
                <question-mark-tip :tip-title="$t('xzsbcsTip')" >
                </question-mark-tip>
                {{ $t('xzsbcs') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item
                :colon="false"
                prop="countDown"
              >
                <table-ellipsis :text="formDataItems.failureNumber || '-'"></table-ellipsis>
              </a-form-model-item>
            </a-col>
          </a-row>
        </a-col>
      </a-row>
      <a-row >
        <!-- 升级失败次数 -->
        <a-col :md="8" :sm="24">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item
                :colon="false"
                class="deepClass"
              >
                <question-mark-tip :tip-title="$t('sjsbcsTip')" >
                </question-mark-tip>
                {{ $t('sjsbcs') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item
                :colon="false"
                prop="countDown"
              >
                <table-ellipsis :text="formDataItems.upgradeFailureNumber || '-'"></table-ellipsis>
              </a-form-model-item>
            </a-col>
          </a-row>
        </a-col>
        <!-- 是否自由烧写 -->
        <!-- <a-col :md="8" :sm="24">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item
                :colon="false"
                class="deepClass"
              >
                {{ $t('sfzysx') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item
                :colon="false"
                prop="countDown"
              >
                <table-ellipsis :text="$t(formDataItems.isFreeBurning === '1' ? 'yes' : 'no')"></table-ellipsis>
              </a-form-model-item>
            </a-col>
          </a-row>
        </a-col> -->
        <!-- 自由烧写次数 -->
        <!-- <a-col :md="8" :sm="24">
          <a-row>
            <a-col :md="9" :sm="24">
              <a-form-model-item
                :colon="false"
                class="deepClass"
              >
                {{ $t('zysxCount') }}
              </a-form-model-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-model-item
                :colon="false"
                prop="countDown"
              >
                <table-ellipsis :text="formDataItems.freeBurningTime || '-'"></table-ellipsis>
              </a-form-model-item>
            </a-col>
          </a-row>
        </a-col> -->
      </a-row>
    </a-form-model-item>
    </a-spin>
    
    <view-release-note
      ref="releaseNote"
      :width="600"
      :releaseNotes="releaseNotes || {}"
    ></view-release-note>
  </a-form-model>
</template>
<script>
import { downloadBlobFile } from '@/utils/functions'
import ViewReleaseNote from '@/views/components/ViewReleaseNote'
import QuestionMarkTip from '@/views/components/QuestionMarkTip'
import TableEllipsis from '@/components/Ellipsis/TableEllipsis'
import { ecuTableColumns, yesOrNoEnumArr, yesOrNoEnumArr12 } from '../config/list'
import TaskGcyUploadInfo from '@/views/task/components/taskGcyUploadInfo'
import TaskUtil from '@views/task/taskUtil'
import COS from 'cos-js-sdk-v5'
export default {
  components: { TableEllipsis, QuestionMarkTip, ViewReleaseNote,TaskGcyUploadInfo },
  data () {
    return {
      TaskUtil,
      loading:true,
      formLayout: 'horizontal',
      showEdit: false,
      columns: ecuTableColumns,
      showEcuTable: true,
      yesOrNoEnumArr,
      formData: {
        task: {},
        strategyVo: {},
        taskGcyExtVo: {},
        conditionStrategyVo: {
          items: []
        },
        instanceResponse: {
          tasks: [],
          viewer: {
            finishedTaskSet: [],
            finishedSequenceFlowSet: [],
            unfinishedTaskSet: [],
            rejectedTaskSet: []
          }
        },
        taskUpgradeStatisticsVo: {},
        vehicleVersionVo: {
          model: {},
          ecuVersions: [{
            ecu: {},
            version: {} }]
        },
        taskGcyExtVo: {}
      },
      testType:'',
      releaseNotes: null,
      yesOrNoEnumArr12,
      formDataItems: {},
      applyUserName:null
    }
  },
  mounted () {
    // 获取申请内容详情
    this.getApplicationDetail()
    this.getTaskConditionStategy()
    this.$store.dispatch('getGcyOtaUpdateScopeDictCodeData')
    this.$store.dispatch('getGcyOtaSupplierVerifyResultDictCodeData')
    this.$store.dispatch('getFactoryChannelDictCodeData')
  },
  computed:{
    factoryChannelObj () {
      return this.$store.getters.getDictCodeObj('factoryChannelDictCode')
    },
    slienceUpgradeTypeObj () {
      return this.$store.getters.getTaskDictCodeObj('slienceUpgradeType')
    },
    forceUpgradeTypeObj () {
      return this.$store.getters.getTaskDictCodeObj('forceUpgradeType')
    },
  },
  methods: {
    getTaskConditionStategy(){
      this.$api.getTaskConditionById(this.$route.query.key).then(res => {
        if (res.data.length > 0) {
          const obj = {}
          res.data.forEach(item => {
            obj[item.code] = item.value
          })
          this.formDataItems = obj
        }
      })
    },
    // 导出任务车辆
    exportTaskVehicle () {
      this.$api.exportTaskCars({ taskId: this.$route.query.key, type: 1 })
        .then((res) => {
          downloadBlobFile(res, this.$t('export') + this.$t('vehicle') + '.xlsx')
        })
        .finally(() => {
          this.exporting = false
        })
    },
    // 格式化有效时间
    formatExpirationDate (time) {
      return Math.ceil(time / 1000 / 24 / 60 / 60)
    },
    // 点击查看发布说明
    showRelease (version) {
      this.$api.versionInfor({ id: version.versionId }).then(response => {
        this.releaseNotes = {
          description: response.data.description,
          functionAddition: response.data.functionAddition,
          functionOptimization: response.data.functionOptimization,
          acknowledgements: response.data.acknowledgements
        }
      }).finally(
        this.$refs.releaseNote.visible = true
      )
    },
    // tooltip弹出防止错位
    getPopupContainerColumn () {
      return document.body
    },
    // 根据申请人id获取名称
    getUserName(){
      // if (this.formData.task.channel == '1') {
      //   return;
      // }
      this.$api.getUserInfo({
        id:this.formData.taskGcyExtVo.applyUserId
      }).then((res)=>{
        this.applyUserName=res.data.name
      });
    },
    // 获取申请内容详情
    getApplicationDetail () {
      this.$api.getTaskApplicationDetailGcy({
        taskId: this.$route.query.key,
        instanceId: this.$route.query.id,
        businessCode: this.$route.query.swcode
      }).then((res) => {
        this.loading = false
        this.formData = res.data
        this.getUserName()
        this.testType = res.data.task.testType
        this.ecuVersionQueruId = res.data.vehicleVersionVo.id
        // 向父组件传值，把升级类型返回给父
        this.$emit("sendUploadType",res.data.task.type);
        //向父组件传值，把工程院审核结果返回给父。
        this.$emit("sendTaskType",res.data.vsmsRequestDto.approvalInfo.status);
      }).catch(() => {
            this.loading = false
          })
    },
  }
}
</script>
<style lang="less" scoped>
::v-deep .ant-form-item{
margin-bottom: 8px ;
}
::v-deep .deepClass{
    font-weight: 600;
    margin-right: 38px;
    text-align: right;

}
::v-deep .ant-form-item-label {
    font-weight: 600;
    margin-right: 12px;
}
  .customFormModelItem2 {
      ::v-deep .ant-form-item-label {
        &::before {
          display: inline-block;
          content: '';
          width: 6px;
          background-color: rgba(67, 136, 166, 1);
          height: 14px;
          vertical-align: middle;
          margin-right: 3px;
        }
      }
    }
</style>
